Shader "Optimized/Reflective/Specular"
{
  Properties
  {
    _Color ("Main Color", Color) = (1,1,1,1)
    _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,1)
    _Shininess ("Shininess", Range(0.01, 1)) = 0.078125
    _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
    _Cube ("Reflection Cubemap", Cube) = "_Skybox" {}
  }
  SubShader
  {
    Tags
    { 
      "RenderType" = "Opaque"
    }
    LOD 100
    Pass // ind: 1, name: FORWARD
    {
      Name "FORWARD"
      Tags
      { 
        "LIGHTMODE" = "FORWARDBASE"
        "RenderType" = "Opaque"
        "SHADOWSUPPORT" = "true"
      }
      LOD 100
      // m_ProgramMask = 6
      CGPROGRAM
      #pragma multi_compile DIRECTIONAL
      //#pragma target 4.0
      
      #pragma vertex vert
      #pragma fragment frag
      
      #include "UnityCG.cginc"
      #define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
      #define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
      #define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
      
      
      #define CODE_BLOCK_VERTEX
      //uniform float3 _WorldSpaceCameraPos;
      //uniform float4x4 unity_ObjectToWorld;
      //uniform float4x4 unity_WorldToObject;
      //uniform float4x4 unity_MatrixVP;
      uniform float4 _MainTex_ST;
      //uniform float4 _WorldSpaceLightPos0;
      uniform float4 _LightColor0;
      uniform float4 _SpecColor;
      uniform sampler2D _MainTex;
      uniform samplerCUBE _Cube;
      uniform float4 _Color;
      uniform float _Shininess;
      struct appdata_t
      {
          float4 vertex :POSITION;
          float3 normal :NORMAL;
          float4 texcoord :TEXCOORD0;
      };
      
      struct OUT_Data_Vert
      {
          float2 xlv_TEXCOORD0 :TEXCOORD0;
          float3 xlv_TEXCOORD1 :TEXCOORD1;
          float3 xlv_TEXCOORD2 :TEXCOORD2;
          float4 xlv_TEXCOORD3 :TEXCOORD3;
          float4 xlv_TEXCOORD6 :TEXCOORD6;
          float4 vertex :SV_POSITION;
      };
      
      struct v2f
      {
          float2 xlv_TEXCOORD0 :TEXCOORD0;
          float3 xlv_TEXCOORD1 :TEXCOORD1;
          float3 xlv_TEXCOORD2 :TEXCOORD2;
          float4 xlv_TEXCOORD3 :TEXCOORD3;
      };
      
      struct OUT_Data_Frag
      {
          float4 color :SV_Target0;
      };
      
      OUT_Data_Vert vert(appdata_t in_v)
      {
          OUT_Data_Vert out_v;
          float3 tmpvar_1;
          float4 tmpvar_2;
          float4 tmpvar_3;
          float4 tmpvar_4;
          tmpvar_4.w = 1;
          tmpvar_4.xyz = in_v.vertex.xyz;
          float3 tmpvar_5;
          tmpvar_5 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
          float3x3 tmpvar_6;
          tmpvar_6[0] = conv_mxt4x4_0(unity_WorldToObject).xyz;
          tmpvar_6[1] = conv_mxt4x4_1(unity_WorldToObject).xyz;
          tmpvar_6[2] = conv_mxt4x4_2(unity_WorldToObject).xyz;
          float3 tmpvar_7;
          tmpvar_7 = normalize(mul(in_v.normal, tmpvar_6));
          tmpvar_2.xyz = float3(tmpvar_5);
          float3 tmpvar_8;
          float3 I_9;
          I_9 = (tmpvar_5 - _WorldSpaceCameraPos);
          tmpvar_8 = (I_9 - (2 * (dot(tmpvar_7, I_9) * tmpvar_7)));
          tmpvar_1 = tmpvar_8;
          out_v.vertex = mul(unity_MatrixVP, mul(unity_ObjectToWorld, tmpvar_4));
          out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
          out_v.xlv_TEXCOORD1 = tmpvar_1;
          out_v.xlv_TEXCOORD2 = tmpvar_7;
          out_v.xlv_TEXCOORD3 = tmpvar_2;
          out_v.xlv_TEXCOORD6 = tmpvar_3;
          return out_v;
      }
      
      #define CODE_BLOCK_FRAGMENT
      OUT_Data_Frag frag(v2f in_f)
      {
          OUT_Data_Frag out_f;
          float3 tmpvar_1;
          float3 tmpvar_2;
          float4 c_3;
          float3 tmpvar_4;
          float3 worldViewDir_5;
          float3 lightDir_6;
          float3 tmpvar_7;
          float3 tmpvar_8;
          tmpvar_8 = _WorldSpaceLightPos0.xyz;
          lightDir_6 = tmpvar_8;
          worldViewDir_5 = normalize((_WorldSpaceCameraPos - in_f.xlv_TEXCOORD3.xyz));
          tmpvar_7 = in_f.xlv_TEXCOORD1;
          tmpvar_4 = in_f.xlv_TEXCOORD2;
          float4 tmpvar_9;
          tmpvar_9 = tex2D(_MainTex, in_f.xlv_TEXCOORD0);
          tmpvar_1 = _LightColor0.xyz;
          tmpvar_2 = lightDir_6;
          float3 viewDir_10;
          viewDir_10 = worldViewDir_5;
          float4 c_11;
          float4 c_12;
          float nh_13;
          float diff_14;
          float tmpvar_15;
          tmpvar_15 = max(0, dot(tmpvar_4, tmpvar_2));
          diff_14 = tmpvar_15;
          float tmpvar_16;
          tmpvar_16 = max(0, dot(tmpvar_4, normalize((tmpvar_2 + viewDir_10))));
          nh_13 = tmpvar_16;
          float y_17;
          y_17 = (_Shininess * 128);
          float tmpvar_18;
          tmpvar_18 = (pow(nh_13, y_17) * tmpvar_9.w);
          c_12.xyz = (((((tmpvar_9 * _Color).xyz + texCUBE(_Cube, tmpvar_7).xyz) * tmpvar_1) * diff_14) + ((tmpvar_1 * _SpecColor.xyz) * tmpvar_18));
          c_12.w = 0;
          c_11.w = c_12.w;
          c_11.xyz = c_12.xyz;
          c_3.xyz = c_11.xyz;
          c_3.w = 1;
          out_f.color = c_3;
          return out_f;
      }
      
      
      ENDCG
      
    } // end phase
    Pass // ind: 2, name: FORWARD
    {
      Name "FORWARD"
      Tags
      { 
        "LIGHTMODE" = "FORWARDADD"
        "RenderType" = "Opaque"
      }
      LOD 100
      ZWrite Off
      Blend One One
      // m_ProgramMask = 6
      CGPROGRAM
      #pragma multi_compile POINT
      //#pragma target 4.0
      
      #pragma vertex vert
      #pragma fragment frag
      
      #include "UnityCG.cginc"
      #define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
      #define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
      #define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
      
      
      #define CODE_BLOCK_VERTEX
      //uniform float3 _WorldSpaceCameraPos;
      //uniform float4x4 unity_ObjectToWorld;
      //uniform float4x4 unity_WorldToObject;
      //uniform float4x4 unity_MatrixVP;
      uniform float4x4 unity_WorldToLight;
      uniform float4 _MainTex_ST;
      //uniform float4 _WorldSpaceLightPos0;
      uniform float4 _LightColor0;
      uniform float4 _SpecColor;
      uniform sampler2D _LightTexture0;
      uniform sampler2D _MainTex;
      uniform samplerCUBE _Cube;
      uniform float4 _Color;
      uniform float _Shininess;
      struct appdata_t
      {
          float4 vertex :POSITION;
          float3 normal :NORMAL;
          float4 texcoord :TEXCOORD0;
      };
      
      struct OUT_Data_Vert
      {
          float2 xlv_TEXCOORD0 :TEXCOORD0;
          float3 xlv_TEXCOORD1 :TEXCOORD1;
          float3 xlv_TEXCOORD2 :TEXCOORD2;
          float3 xlv_TEXCOORD3 :TEXCOORD3;
          float3 xlv_TEXCOORD4 :TEXCOORD4;
          float4 xlv_TEXCOORD5 :TEXCOORD5;
          float4 vertex :SV_POSITION;
      };
      
      struct v2f
      {
          float2 xlv_TEXCOORD0 :TEXCOORD0;
          float3 xlv_TEXCOORD1 :TEXCOORD1;
          float3 xlv_TEXCOORD2 :TEXCOORD2;
          float3 xlv_TEXCOORD3 :TEXCOORD3;
      };
      
      struct OUT_Data_Frag
      {
          float4 color :SV_Target0;
      };
      
      OUT_Data_Vert vert(appdata_t in_v)
      {
          OUT_Data_Vert out_v;
          float3 tmpvar_1;
          float4 tmpvar_2;
          float4 tmpvar_3;
          tmpvar_3.w = 1;
          tmpvar_3.xyz = in_v.vertex.xyz;
          float4 tmpvar_4;
          tmpvar_4 = mul(unity_ObjectToWorld, in_v.vertex);
          float3x3 tmpvar_5;
          tmpvar_5[0] = conv_mxt4x4_0(unity_WorldToObject).xyz;
          tmpvar_5[1] = conv_mxt4x4_1(unity_WorldToObject).xyz;
          tmpvar_5[2] = conv_mxt4x4_2(unity_WorldToObject).xyz;
          float3 tmpvar_6;
          tmpvar_6 = normalize(mul(in_v.normal, tmpvar_5));
          float3 tmpvar_7;
          float3 I_8;
          I_8 = (tmpvar_4.xyz - _WorldSpaceCameraPos);
          tmpvar_7 = (I_8 - (2 * (dot(tmpvar_6, I_8) * tmpvar_6)));
          tmpvar_1 = tmpvar_7;
          out_v.vertex = mul(unity_MatrixVP, mul(unity_ObjectToWorld, tmpvar_3));
          out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
          out_v.xlv_TEXCOORD1 = tmpvar_1;
          out_v.xlv_TEXCOORD2 = tmpvar_6;
          out_v.xlv_TEXCOORD3 = tmpvar_4.xyz;
          out_v.xlv_TEXCOORD4 = mul(unity_WorldToLight, tmpvar_4).xyz;
          out_v.xlv_TEXCOORD5 = tmpvar_2;
          return out_v;
      }
      
      #define CODE_BLOCK_FRAGMENT
      OUT_Data_Frag frag(v2f in_f)
      {
          OUT_Data_Frag out_f;
          float3 tmpvar_1;
          float3 tmpvar_2;
          float4 c_3;
          float atten_4;
          float3 lightCoord_5;
          float3 tmpvar_6;
          float3 worldViewDir_7;
          float3 lightDir_8;
          float3 tmpvar_9;
          float3 tmpvar_10;
          tmpvar_10 = normalize((_WorldSpaceLightPos0.xyz - in_f.xlv_TEXCOORD3));
          lightDir_8 = tmpvar_10;
          worldViewDir_7 = normalize((_WorldSpaceCameraPos - in_f.xlv_TEXCOORD3));
          tmpvar_9 = in_f.xlv_TEXCOORD1;
          tmpvar_6 = in_f.xlv_TEXCOORD2;
          float4 tmpvar_11;
          tmpvar_11 = tex2D(_MainTex, in_f.xlv_TEXCOORD0);
          float4 tmpvar_12;
          tmpvar_12.w = 1;
          tmpvar_12.xyz = in_f.xlv_TEXCOORD3;
          lightCoord_5 = mul(unity_WorldToLight, tmpvar_12).xyz;
          float tmpvar_13;
          float _tmp_dvx_0 = dot(lightCoord_5, lightCoord_5);
          tmpvar_13 = tex2D(_LightTexture0, float2(_tmp_dvx_0, _tmp_dvx_0)).x;
          atten_4 = tmpvar_13;
          tmpvar_1 = _LightColor0.xyz;
          tmpvar_2 = lightDir_8;
          tmpvar_1 = (tmpvar_1 * atten_4);
          float3 viewDir_14;
          viewDir_14 = worldViewDir_7;
          float4 c_15;
          float4 c_16;
          float nh_17;
          float diff_18;
          float tmpvar_19;
          tmpvar_19 = max(0, dot(tmpvar_6, tmpvar_2));
          diff_18 = tmpvar_19;
          float tmpvar_20;
          tmpvar_20 = max(0, dot(tmpvar_6, normalize((tmpvar_2 + viewDir_14))));
          nh_17 = tmpvar_20;
          float y_21;
          y_21 = (_Shininess * 128);
          float tmpvar_22;
          tmpvar_22 = (pow(nh_17, y_21) * tmpvar_11.w);
          c_16.xyz = (((((tmpvar_11 * _Color).xyz + texCUBE(_Cube, tmpvar_9).xyz) * tmpvar_1) * diff_18) + ((tmpvar_1 * _SpecColor.xyz) * tmpvar_22));
          c_16.w = 0;
          c_15.w = c_16.w;
          c_15.xyz = c_16.xyz;
          c_3.xyz = c_15.xyz;
          c_3.w = 1;
          out_f.color = c_3;
          return out_f;
      }
      
      
      ENDCG
      
    } // end phase
    Pass // ind: 3, name: PREPASS
    {
      Name "PREPASS"
      Tags
      { 
        "LIGHTMODE" = "PREPASSBASE"
        "RenderType" = "Opaque"
      }
      LOD 100
      // m_ProgramMask = 6
      CGPROGRAM
      //#pragma target 4.0
      
      #pragma vertex vert
      #pragma fragment frag
      
      #include "UnityCG.cginc"
      #define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
      #define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
      #define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
      
      
      #define CODE_BLOCK_VERTEX
      //uniform float4x4 unity_ObjectToWorld;
      //uniform float4x4 unity_WorldToObject;
      //uniform float4x4 unity_MatrixVP;
      uniform float _Shininess;
      struct appdata_t
      {
          float4 vertex :POSITION;
          float3 normal :NORMAL;
      };
      
      struct OUT_Data_Vert
      {
          float3 xlv_TEXCOORD0 :TEXCOORD0;
          float3 xlv_TEXCOORD1 :TEXCOORD1;
          float4 vertex :SV_POSITION;
      };
      
      struct v2f
      {
          float3 xlv_TEXCOORD0 :TEXCOORD0;
      };
      
      struct OUT_Data_Frag
      {
          float4 color :SV_Target0;
      };
      
      OUT_Data_Vert vert(appdata_t in_v)
      {
          OUT_Data_Vert out_v;
          float4 tmpvar_1;
          tmpvar_1.w = 1;
          tmpvar_1.xyz = in_v.vertex.xyz;
          float3x3 tmpvar_2;
          tmpvar_2[0] = conv_mxt4x4_0(unity_WorldToObject).xyz;
          tmpvar_2[1] = conv_mxt4x4_1(unity_WorldToObject).xyz;
          tmpvar_2[2] = conv_mxt4x4_2(unity_WorldToObject).xyz;
          out_v.vertex = mul(unity_MatrixVP, mul(unity_ObjectToWorld, tmpvar_1));
          out_v.xlv_TEXCOORD0 = normalize(mul(in_v.normal, tmpvar_2));
          out_v.xlv_TEXCOORD1 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
          return out_v;
      }
      
      #define CODE_BLOCK_FRAGMENT
      OUT_Data_Frag frag(v2f in_f)
      {
          OUT_Data_Frag out_f;
          float4 res_1;
          float3 tmpvar_2;
          tmpvar_2 = in_f.xlv_TEXCOORD0;
          res_1.xyz = float3(((tmpvar_2 * 0.5) + 0.5));
          res_1.w = _Shininess;
          out_f.color = res_1;
          return out_f;
      }
      
      
      ENDCG
      
    } // end phase
    Pass // ind: 4, name: PREPASS
    {
      Name "PREPASS"
      Tags
      { 
        "LIGHTMODE" = "PREPASSFINAL"
        "RenderType" = "Opaque"
      }
      LOD 100
      ZWrite Off
      // m_ProgramMask = 6
      CGPROGRAM
      //#pragma target 4.0
      
      #pragma vertex vert
      #pragma fragment frag
      
      #include "UnityCG.cginc"
      #define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
      #define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
      #define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
      
      
      #define CODE_BLOCK_VERTEX
      //uniform float3 _WorldSpaceCameraPos;
      //uniform float4 _ProjectionParams;
      //uniform float4 unity_SHAr;
      //uniform float4 unity_SHAg;
      //uniform float4 unity_SHAb;
      //uniform float4 unity_SHBr;
      //uniform float4 unity_SHBg;
      //uniform float4 unity_SHBb;
      //uniform float4 unity_SHC;
      //uniform float4x4 unity_ObjectToWorld;
      //uniform float4x4 unity_WorldToObject;
      //uniform float4x4 unity_MatrixVP;
      uniform float4 _MainTex_ST;
      uniform float4 _SpecColor;
      uniform sampler2D _MainTex;
      uniform samplerCUBE _Cube;
      uniform float4 _Color;
      uniform sampler2D _LightBuffer;
      struct appdata_t
      {
          float4 vertex :POSITION;
          float3 normal :NORMAL;
          float4 texcoord :TEXCOORD0;
      };
      
      struct OUT_Data_Vert
      {
          float2 xlv_TEXCOORD0 :TEXCOORD0;
          float3 xlv_TEXCOORD1 :TEXCOORD1;
          float3 xlv_TEXCOORD2 :TEXCOORD2;
          float4 xlv_TEXCOORD3 :TEXCOORD3;
          float4 xlv_TEXCOORD4 :TEXCOORD4;
          float3 xlv_TEXCOORD5 :TEXCOORD5;
          float4 vertex :SV_POSITION;
      };
      
      struct v2f
      {
          float2 xlv_TEXCOORD0 :TEXCOORD0;
          float3 xlv_TEXCOORD1 :TEXCOORD1;
          float4 xlv_TEXCOORD3 :TEXCOORD3;
          float3 xlv_TEXCOORD5 :TEXCOORD5;
      };
      
      struct OUT_Data_Frag
      {
          float4 color :SV_Target0;
      };
      
      OUT_Data_Vert vert(appdata_t in_v)
      {
          OUT_Data_Vert out_v;
          float3 tmpvar_1;
          float4 tmpvar_2;
          float3 tmpvar_3;
          float4 tmpvar_4;
          float4 tmpvar_5;
          tmpvar_5.w = 1;
          tmpvar_5.xyz = in_v.vertex.xyz;
          tmpvar_4 = mul(unity_MatrixVP, mul(unity_ObjectToWorld, tmpvar_5));
          float3 tmpvar_6;
          tmpvar_6 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
          float3x3 tmpvar_7;
          tmpvar_7[0] = conv_mxt4x4_0(unity_WorldToObject).xyz;
          tmpvar_7[1] = conv_mxt4x4_1(unity_WorldToObject).xyz;
          tmpvar_7[2] = conv_mxt4x4_2(unity_WorldToObject).xyz;
          float3 tmpvar_8;
          tmpvar_8 = normalize(mul(in_v.normal, tmpvar_7));
          float3 tmpvar_9;
          float3 I_10;
          I_10 = (tmpvar_6 - _WorldSpaceCameraPos);
          tmpvar_9 = (I_10 - (2 * (dot(tmpvar_8, I_10) * tmpvar_8)));
          tmpvar_1 = tmpvar_9;
          float4 o_11;
          float4 tmpvar_12;
          tmpvar_12 = (tmpvar_4 * 0.5);
          float2 tmpvar_13;
          tmpvar_13.x = tmpvar_12.x;
          tmpvar_13.y = (tmpvar_12.y * _ProjectionParams.x);
          o_11.xy = (tmpvar_13 + tmpvar_12.w);
          o_11.zw = tmpvar_4.zw;
          tmpvar_2.zw = float2(0, 0);
          tmpvar_2.xy = float2(0, 0);
          float3x3 tmpvar_14;
          tmpvar_14[0] = conv_mxt4x4_0(unity_WorldToObject).xyz;
          tmpvar_14[1] = conv_mxt4x4_1(unity_WorldToObject).xyz;
          tmpvar_14[2] = conv_mxt4x4_2(unity_WorldToObject).xyz;
          float4 tmpvar_15;
          tmpvar_15.w = 1;
          tmpvar_15.xyz = float3(normalize(mul(in_v.normal, tmpvar_14)));
          float4 normal_16;
          normal_16 = tmpvar_15;
          float3 res_17;
          float3 x_18;
          x_18.x = dot(unity_SHAr, normal_16);
          x_18.y = dot(unity_SHAg, normal_16);
          x_18.z = dot(unity_SHAb, normal_16);
          float3 x1_19;
          float4 tmpvar_20;
          tmpvar_20 = (normal_16.xyzz * normal_16.yzzx);
          x1_19.x = dot(unity_SHBr, tmpvar_20);
          x1_19.y = dot(unity_SHBg, tmpvar_20);
          x1_19.z = dot(unity_SHBb, tmpvar_20);
          res_17 = (x_18 + (x1_19 + (unity_SHC.xyz * ((normal_16.x * normal_16.x) - (normal_16.y * normal_16.y)))));
          float3 tmpvar_21;
          float _tmp_dvx_1 = max(((1.055 * pow(max(res_17, float3(0, 0, 0)), float3(0.4166667, 0.4166667, 0.4166667))) - 0.055), float3(0, 0, 0));
          tmpvar_21 = float3(_tmp_dvx_1, _tmp_dvx_1, _tmp_dvx_1);
          res_17 = tmpvar_21;
          tmpvar_3 = tmpvar_21;
          out_v.vertex = tmpvar_4;
          out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
          out_v.xlv_TEXCOORD1 = tmpvar_1;
          out_v.xlv_TEXCOORD2 = tmpvar_6;
          out_v.xlv_TEXCOORD3 = o_11;
          out_v.xlv_TEXCOORD4 = tmpvar_2;
          out_v.xlv_TEXCOORD5 = tmpvar_3;
          return out_v;
      }
      
      #define CODE_BLOCK_FRAGMENT
      OUT_Data_Frag frag(v2f in_f)
      {
          OUT_Data_Frag out_f;
          float4 tmpvar_1;
          float4 c_2;
          float4 light_3;
          float3 tmpvar_4;
          tmpvar_4 = in_f.xlv_TEXCOORD1;
          float4 tmpvar_5;
          tmpvar_5 = tex2D(_MainTex, in_f.xlv_TEXCOORD0);
          float4 tmpvar_6;
          tmpvar_6 = tex2D(_LightBuffer, in_f.xlv_TEXCOORD3);
          light_3 = tmpvar_6;
          light_3 = (-log2(max(light_3, float4(0.001, 0.001, 0.001, 0.001))));
          light_3.xyz = (light_3.xyz + in_f.xlv_TEXCOORD5);
          float4 c_7;
          float spec_8;
          float tmpvar_9;
          tmpvar_9 = (light_3.w * tmpvar_5.w);
          spec_8 = tmpvar_9;
          c_7.xyz = ((((tmpvar_5 * _Color).xyz + texCUBE(_Cube, tmpvar_4).xyz) * light_3.xyz) + ((light_3.xyz * _SpecColor.xyz) * spec_8));
          c_7.w = 0;
          c_2.xyz = c_7.xyz;
          c_2.w = 1;
          tmpvar_1 = c_2;
          out_f.color = tmpvar_1;
          return out_f;
      }
      
      
      ENDCG
      
    } // end phase
    Pass // ind: 5, name: DEFERRED
    {
      Name "DEFERRED"
      Tags
      { 
        "LIGHTMODE" = "DEFERRED"
        "RenderType" = "Opaque"
      }
      LOD 100
      // m_ProgramMask = 6
      CGPROGRAM
      //#pragma target 4.0
      
      #pragma vertex vert
      #pragma fragment frag
      
      #include "UnityCG.cginc"
      #define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
      #define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
      #define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
      
      
      #define CODE_BLOCK_VERTEX
      //uniform float3 _WorldSpaceCameraPos;
      //uniform float4x4 unity_ObjectToWorld;
      //uniform float4x4 unity_WorldToObject;
      //uniform float4x4 unity_MatrixVP;
      uniform float4 _MainTex_ST;
      uniform float4 _SpecColor;
      uniform sampler2D _MainTex;
      uniform samplerCUBE _Cube;
      uniform float4 _Color;
      uniform float _Shininess;
      struct appdata_t
      {
          float4 vertex :POSITION;
          float3 normal :NORMAL;
          float4 texcoord :TEXCOORD0;
      };
      
      struct OUT_Data_Vert
      {
          float2 xlv_TEXCOORD0 :TEXCOORD0;
          float3 xlv_TEXCOORD1 :TEXCOORD1;
          float3 xlv_TEXCOORD2 :TEXCOORD2;
          float3 xlv_TEXCOORD3 :TEXCOORD3;
          float4 xlv_TEXCOORD4 :TEXCOORD4;
          float4 vertex :SV_POSITION;
      };
      
      struct v2f
      {
          float2 xlv_TEXCOORD0 :TEXCOORD0;
          float3 xlv_TEXCOORD1 :TEXCOORD1;
          float3 xlv_TEXCOORD2 :TEXCOORD2;
      };
      
      struct OUT_Data_Frag
      {
          float4 color :SV_Target0;
          float4 color1 :SV_Target1;
          float4 color2 :SV_Target2;
          float4 color3 :SV_Target3;
      };
      
      OUT_Data_Vert vert(appdata_t in_v)
      {
          OUT_Data_Vert out_v;
          float3 tmpvar_1;
          float4 tmpvar_2;
          float4 tmpvar_3;
          tmpvar_3.w = 1;
          tmpvar_3.xyz = in_v.vertex.xyz;
          float3 tmpvar_4;
          tmpvar_4 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
          float3x3 tmpvar_5;
          tmpvar_5[0] = conv_mxt4x4_0(unity_WorldToObject).xyz;
          tmpvar_5[1] = conv_mxt4x4_1(unity_WorldToObject).xyz;
          tmpvar_5[2] = conv_mxt4x4_2(unity_WorldToObject).xyz;
          float3 tmpvar_6;
          tmpvar_6 = normalize(mul(in_v.normal, tmpvar_5));
          float3 tmpvar_7;
          float3 I_8;
          I_8 = (tmpvar_4 - _WorldSpaceCameraPos);
          tmpvar_7 = (I_8 - (2 * (dot(tmpvar_6, I_8) * tmpvar_6)));
          tmpvar_1 = tmpvar_7;
          tmpvar_2.zw = float2(0, 0);
          tmpvar_2.xy = float2(0, 0);
          out_v.vertex = mul(unity_MatrixVP, mul(unity_ObjectToWorld, tmpvar_3));
          out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
          out_v.xlv_TEXCOORD1 = tmpvar_1;
          out_v.xlv_TEXCOORD2 = tmpvar_6;
          out_v.xlv_TEXCOORD3 = tmpvar_4;
          out_v.xlv_TEXCOORD4 = tmpvar_2;
          return out_v;
      }
      
      #define CODE_BLOCK_FRAGMENT
      OUT_Data_Frag frag(v2f in_f)
      {
          OUT_Data_Frag out_f;
          float4 outEmission_1;
          float3 tmpvar_2;
          float3 tmpvar_3;
          tmpvar_3 = in_f.xlv_TEXCOORD1;
          tmpvar_2 = in_f.xlv_TEXCOORD2;
          float3 tmpvar_4;
          float4 tmpvar_5;
          tmpvar_5 = tex2D(_MainTex, in_f.xlv_TEXCOORD0);
          tmpvar_4 = ((tmpvar_5 * _Color).xyz + texCUBE(_Cube, tmpvar_3).xyz);
          float4 emission_6;
          float3 tmpvar_7;
          float3 tmpvar_8;
          float3 tmpvar_9;
          tmpvar_7 = tmpvar_4;
          tmpvar_8 = ((_SpecColor.xyz * tmpvar_5.w) * 0.3183099);
          tmpvar_9 = tmpvar_2;
          float4 outGBuffer2_10;
          float4 tmpvar_11;
          tmpvar_11.xyz = float3(tmpvar_7);
          tmpvar_11.w = 1;
          float4 tmpvar_12;
          tmpvar_12.xyz = float3(tmpvar_8);
          tmpvar_12.w = _Shininess;
          float4 tmpvar_13;
          tmpvar_13.w = 1;
          tmpvar_13.xyz = float3(((tmpvar_9 * 0.5) + 0.5));
          outGBuffer2_10 = tmpvar_13;
          float4 tmpvar_14;
          tmpvar_14.w = 1;
          tmpvar_14.xyz = float3(0, 0, 0);
          emission_6 = tmpvar_14;
          emission_6.xyz = emission_6.xyz;
          outEmission_1.w = emission_6.w;
          outEmission_1.xyz = exp2((-emission_6.xyz));
          out_f.color = tmpvar_11;
          out_f.color1 = tmpvar_12;
          out_f.color2 = outGBuffer2_10;
          out_f.color3 = outEmission_1;
          return out_f;
      }
      
      
      ENDCG
      
    } // end phase
    Pass // ind: 6, name: Meta
    {
      Name "Meta"
      Tags
      { 
        "LIGHTMODE" = "META"
        "RenderType" = "Opaque"
      }
      LOD 100
      Cull Off
      // m_ProgramMask = 6
      CGPROGRAM
      //#pragma target 4.0
      
      #pragma vertex vert
      #pragma fragment frag
      
      #include "UnityCG.cginc"
      #define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
      #define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
      #define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
      
      
      #define CODE_BLOCK_VERTEX
      //uniform float3 _WorldSpaceCameraPos;
      //uniform float4x4 unity_ObjectToWorld;
      //uniform float4x4 unity_WorldToObject;
      //uniform float4x4 unity_MatrixVP;
      uniform float4 unity_LightmapST;
      uniform float4 unity_DynamicLightmapST;
      uniform float4 unity_MetaVertexControl;
      uniform float4 _MainTex_ST;
      uniform sampler2D _MainTex;
      uniform samplerCUBE _Cube;
      uniform float4 _Color;
      uniform float4 unity_MetaFragmentControl;
      uniform float unity_OneOverOutputBoost;
      uniform float unity_MaxOutputValue;
      uniform float unity_UseLinearSpace;
      struct appdata_t
      {
          float4 vertex :POSITION;
          float3 normal :NORMAL;
          float4 texcoord :TEXCOORD0;
          float4 texcoord1 :TEXCOORD1;
          float4 texcoord2 :TEXCOORD2;
      };
      
      struct OUT_Data_Vert
      {
          float2 xlv_TEXCOORD0 :TEXCOORD0;
          float3 xlv_TEXCOORD1 :TEXCOORD1;
          float3 xlv_TEXCOORD2 :TEXCOORD2;
          float4 vertex :SV_POSITION;
      };
      
      struct v2f
      {
          float2 xlv_TEXCOORD0 :TEXCOORD0;
          float3 xlv_TEXCOORD1 :TEXCOORD1;
      };
      
      struct OUT_Data_Frag
      {
          float4 color :SV_Target0;
      };
      
      OUT_Data_Vert vert(appdata_t in_v)
      {
          OUT_Data_Vert out_v;
          float3 tmpvar_1;
          float4 vertex_2;
          vertex_2 = in_v.vertex;
          if(unity_MetaVertexControl.x)
          {
              vertex_2.xy = ((in_v.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
              float tmpvar_3;
              if((in_v.vertex.z>0))
              {
                  tmpvar_3 = 0.0001;
              }
              else
              {
                  tmpvar_3 = 0;
              }
              vertex_2.z = tmpvar_3;
          }
          if(unity_MetaVertexControl.y)
          {
              vertex_2.xy = ((in_v.texcoord2.xy * unity_DynamicLightmapST.xy) + unity_DynamicLightmapST.zw);
              float tmpvar_4;
              if((vertex_2.z>0))
              {
                  tmpvar_4 = 0.0001;
              }
              else
              {
                  tmpvar_4 = 0;
              }
              vertex_2.z = tmpvar_4;
          }
          float4 tmpvar_5;
          tmpvar_5.w = 1;
          tmpvar_5.xyz = vertex_2.xyz;
          float3 tmpvar_6;
          tmpvar_6 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
          float3x3 tmpvar_7;
          tmpvar_7[0] = conv_mxt4x4_0(unity_WorldToObject).xyz;
          tmpvar_7[1] = conv_mxt4x4_1(unity_WorldToObject).xyz;
          tmpvar_7[2] = conv_mxt4x4_2(unity_WorldToObject).xyz;
          float3 tmpvar_8;
          tmpvar_8 = normalize(mul(in_v.normal, tmpvar_7));
          float3 tmpvar_9;
          float3 I_10;
          I_10 = (tmpvar_6 - _WorldSpaceCameraPos);
          tmpvar_9 = (I_10 - (2 * (dot(tmpvar_8, I_10) * tmpvar_8)));
          tmpvar_1 = tmpvar_9;
          out_v.vertex = mul(unity_MatrixVP, tmpvar_5);
          out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
          out_v.xlv_TEXCOORD1 = tmpvar_1;
          out_v.xlv_TEXCOORD2 = tmpvar_6;
          return out_v;
      }
      
      #define CODE_BLOCK_FRAGMENT
      OUT_Data_Frag frag(v2f in_f)
      {
          OUT_Data_Frag out_f;
          float4 tmpvar_1;
          float3 tmpvar_2;
          float3 tmpvar_3;
          tmpvar_3 = in_f.xlv_TEXCOORD1;
          float3 tmpvar_4;
          tmpvar_4 = ((tex2D(_MainTex, in_f.xlv_TEXCOORD0) * _Color).xyz + texCUBE(_Cube, tmpvar_3).xyz);
          tmpvar_2 = tmpvar_4;
          float4 res_5;
          res_5 = float4(0, 0, 0, 0);
          if(unity_MetaFragmentControl.x)
          {
              float4 tmpvar_6;
              tmpvar_6.w = 1;
              tmpvar_6.xyz = float3(tmpvar_2);
              res_5.w = tmpvar_6.w;
              float3 tmpvar_7;
              float _tmp_dvx_2 = clamp(unity_OneOverOutputBoost, 0, 1);
              tmpvar_7 = clamp(pow(tmpvar_2, float3(_tmp_dvx_2, _tmp_dvx_2, _tmp_dvx_2)), float3(0, 0, 0), float3(unity_MaxOutputValue, unity_MaxOutputValue, unity_MaxOutputValue));
              res_5.xyz = float3(tmpvar_7);
          }
          if(unity_MetaFragmentControl.y)
          {
              float3 emission_8;
              if(int(unity_UseLinearSpace))
              {
                  emission_8 = float3(0, 0, 0);
              }
              else
              {
                  emission_8 = float3(0, 0, 0);
              }
              float4 tmpvar_9;
              tmpvar_9.w = 1;
              tmpvar_9.xyz = float3(emission_8);
              res_5 = tmpvar_9;
          }
          tmpvar_1 = res_5;
          out_f.color = tmpvar_1;
          return out_f;
      }
      
      
      ENDCG
      
    } // end phase
  }
  FallBack "Optimized/Reflective/VertexLit"
}
